import router from '@/router/index'
import {removeUserInfo} from "../utils/auth";

export function openPositionDetailPage(id) {
    const { href } = router.resolve({
        path: '/',
        query: {
            pid: id,
        },
    })
    window.open(href, '_blank')
}

export function openEntDetailPage(id) {
    const { href } = router.resolve({
        path: '/',
        query: {
            eid: id
        },
    })
    window.open(href, '_blank')
}

export function goLoginAndClear() {
    removeUserInfo()
    router.push({
        path: '/login',
        query: {
            code: 'login'
        }
    })
}

export function openPersonDetailPage(id) {
    const { href } = router.resolve({
        path: '/person/resume',
        query: {
            resumeId: id,
            typeCode: 'ent'
        },
    })
    window.open(href, '_blank')
}

export function addParams(params) {
    router.push({
        query: params
    })
}


